package com.hzvictory.hotel_system.service.Impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.hzvictory.hotel_system.mapper.RoomMapper;
import com.hzvictory.hotel_system.pojo.entity.Room;
import com.hzvictory.hotel_system.service.IRoomService;
/**
 * 功能
 * 作者：何征
 * 日期：2025/7/23 16:49
 */
@Service
public class RoomServiceImpl implements IRoomService
{
    @Autowired
    private RoomMapper roomMapper;

    /**
     * 查询房间表
     *
     * @param id 房间表主键
     * @return 房间表
     */
    @Override
    public Room selectRoomById(Long id)
    {
        return roomMapper.selectRoomById(id);
    }

    /**
     * 查询房间表列表
     *
     * @param room 房间表
     * @return 房间表
     */
    @Override
    public List<Room> selectRoomList(Room room)
    {
        return roomMapper.selectRoomList(room);
    }

    /**
     * 新增房间表
     *
     * @param room 房间表
     * @return 结果
     */
    @Override
    public int insertRoom(Room room)
    {
        return roomMapper.insertRoom(room);
    }

    /**
     * 修改房间表
     *
     * @param room 房间表
     * @return 结果
     */
    @Override
    public int updateRoom(Room room)
    {
        return roomMapper.updateRoom(room);
    }
    /**
     * 修改房间表状态
     *
     * @param id 房间id
     * @return 结果
     */
    public int updateStatus(Long id){
        return roomMapper.updateRoomStatus(id);
    }

    /**
     * 批量删除房间表
     *
     * @param ids 需要删除的房间表主键
     * @return 结果
     */
    @Override
    public int deleteRoomByIds(Long[] ids)
    {
        return roomMapper.deleteRoomByIds(ids);
    }

    /**
     * 删除房间表信息
     *
     * @param id 房间表主键
     * @return 结果
     */
    @Override
    public int deleteRoomById(Long id)
    {
        return roomMapper.deleteRoomById(id);
    }
}